<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>JS Demo</title>
    <!-- 引入样式 -->
    <link rel="stylesheet" href="https://unpkg.com/element-ui@2.5.4/lib/theme-chalk/index.css"> 
</head>
<body>
    <div id="app">
        <el-container>
            <el-header>JS Demo</el-header>
            <el-main>
                <el-row>
                    <el-col :span="24">
                        <el-button type="text" @click="closeEventDemo">窗口关闭事件</el-button>
                    </el-col>
                </el-row>
                <el-row>
                    <el-col :span="24">
                        <el-button type="text" @click="postMessageDemo">postMessageDemo</el-button>
                    </el-col>
                </el-row>
            </el-row>
            <el-row>
                <el-col :span="24">
                    <el-button type="text" @click="workerDemo">H5 worker Demo</el-button>
                </el-col>
            </el-row>
            </el-main>
        </el-container>
    </div>
</body>
<!-- 引入组件库 -->
<script src="https://unpkg.com/vue/dist/vue.js"></script>
<script src="https://unpkg.com/element-ui@2.5.4/lib/index.js"></script>
<script type="text/javascript">
    new Vue({
        el: '#app',
        data() {
            return { 
                tip: 'Hello World!' 
            }
        },
        methods: {
            // 窗口关闭事件
            closeEventDemo () {
                window.open('/CloseEventDemo/Demo.html');
            },
            // postMessageDemo
            postMessageDemo () {
                window.open('/postMessageDemo/index.html');
            },
            // workerDemo
            workerDemo () {
                window.open('/workerDemo/index.html');
            }
        }
    })
</script>

</html>